﻿/* 后台导航等模板配置*/

/* 左边头部 */
var applicationTemplateConfig = {
    menus: [{
        name: '仪表盘',
        icon: 'icon-dashboard',
        link: '',
        children: [{
            name: '测试菜单1',
            link: '/org/index',
            icon: 'icon-caret-right'
        }, {
            name: '测试菜单2',
            link: '#'
        }]
    }, {
        name: '企业成员管理',
        icon: 'icon-group',
        link: '/OrgMember/Index'
    }],
    pathname: location.pathname.toLowerCase(),
    header: header
};

var mainNav = new Vue({
    el: '#main-nav',
    data: applicationTemplateConfig,
    methods: {
        menuIsActive: function (menu) {
            var result = false;
            if (menu.link.toLowerCase() == applicationTemplateConfig.pathname) {
                result = true;
                return result;
            }
            $.each(menu.children, function (index, childMenu) {
                if (childMenu.link === applicationTemplateConfig.pathname) {
                    result = true;
                }
            });
            return result;
        },
        childIsActive: function (childMenu) {
            return childMenu.link === applicationTemplateConfig.pathname;
        }
    },
    ready: function () { }
});

/* 头部 */
var header = false; // 页面头部
// header: {
//     title: 'this is title',
//     icon: 'icon-heart-empty',
//     menus: [{
//         name: 'menu1',
//         icon: 'icon-heart-empty',
//         link: '#'
//     }, {
//         name: 'menu2',
//         icon: 'icon-caret-right',
//         link: '#'
//     }]
// },
var pageHeader = new Vue({
    el: '#page-header',
    data: {
        header: header
    }
});